package homegroup.inc.dao;

import homegroup.inc.dto.Consumer;

import javax.ejb.Stateless;

@Stateless
public class ConsumerDAO extends BaseDAO {
    private Consumer consumer = null;

    public void create(Consumer consumer) {
        entityManager.persist(consumer);
    }

    public Consumer findById(int id) {
        consumer = entityManager.find(Consumer.class, id);
        return consumer;
    }

    public void update (Consumer consumer) {
        entityManager.merge(consumer);
    }

    public void delete (Consumer consumer) {
        entityManager.remove(consumer);
    }
}
